'use strict';
//  A price predict for a period
module.exports = app => {
  const {
    INTEGER,
    DECIMAL,
    FLOAT,
    STRING,
    TEXT,
    DATE,
  } = app.Sequelize;

  const StockExpect = app.model.define('stock_expect', {
    id: {
      type: INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    price_created: {
      type: DECIMAL(6,2),
    },
    price_growth_expect: {
      type: FLOAT,    //  1.2 means 20%+
    },
    period: {
      type: INTEGER,  //  e.g. 20 days.
    },
    // commentSize: {
    //       //   defaultValue: 0,
    // },
    // tags: {
    //   type: STRING(100),
    // },
    // created_at: DATE,
    // updated_at: DATE,

  });

  StockExpect.associate = function() {
    app.model.StockExpect.belongsTo(app.model.UserStock);
    // app.model.Blog.hasMany(app.model.Comment, {
    //   as: 'comment',
    // });
  };
  return StockExpect;
};
